﻿using Server.Constant;
using Server.Framework.Message;
using Server.Model;
using System.Collections.Generic;

namespace Server.Message.Request
{
    /// <summary>
    /// Author: Leil
    /// Description: 新增或编辑请求消息
    /// CreateTime: 2020/5/13 10:07:46
    /// </summary>
    [MessageAttr(MessageId.ADD_EDIT_ORG)]
    class AddEditOrgReq : RequestBaseMessage
    {
        public OrgDao Org { get; private set; }

        public override void Deserialize(byte[] buffer)
        {
            AddEditOrg msg = AddEditOrg.Parser.ParseFrom(buffer);
            if (msg.Org != null)
            {
                Org = new OrgDao
                {
                    ID = msg.Org.Id,
                    ParentId = msg.Org.ParentId,
                    OrgName = msg.Org.OrgName,
                    Status = msg.Org.Status,
                    Sort = msg.Org.Sort
                };
            }
        }
    }
}
